<template>
  <div>
    <menu-nav></menu-nav>
    <router-view v-slot="{ Component }">
      <transition :name="transitionName" mode="out-in">
        <keep-alive>
          <component :is="Component" />
        </keep-alive>
      </transition>
    </router-view>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import MenuNav from '../nav/menu-nav.vue'

export default defineComponent({
  components: {
    MenuNav
  },
  setup() {
    const transitionName = ref('')
    return {
      transitionName
    }
  }
})
</script>

<style scoped></style>
